package com.milo.java7.io.byter;

import org.junit.Test;

import java.io.*;

/**
 * @author Milo Lee
 * @date 2021-04-14 15:38
 */
public class FileInputStreamTest {

    @Test
    public void test1() throws IOException {

        FileInputStream fin = new FileInputStream("E:\\test.txt");
        DataInputStream din = new DataInputStream(fin);
        System.out.println(din.readInt());

        //使用BufferedInputStream缓存,提高效率
        FileInputStream fins = new FileInputStream("E:\\test.txt");
        DataInputStream dins = new DataInputStream(new BufferedInputStream(fins));
        System.out.println(dins.readInt());
    }

}
